(1) Field of the Invention
The present invention relates to a controller for a Small Computer System Interface (hereinafter referred to as an "SCSI") which is a general purpose input/output interface for a medium and small scale computer system standardized by ANSI (American National Standard Institute) as X3.131-1986 and X3T9.2/86-109 Revision 10c, and more particularly to an SCSI controller having a command which unifies standard operations to take place in different phases.
(2) Description of the Related Art
An internal construction of a conventional SCSI controller for performing the operations of arbitration and selection is shown in FIG. 1. Up to eight SCSI devices can be daisy chained on an SCSI bus, and an ID (identifier) from "0" to "7" is assigned for each SCSI device.
In FIG. 1, reference numeral 101 denotes a host system interface; 102 a main sequence controller; 103 an SCSI bus phase register; 104 an arbitration/selection controller; 105 an SCSI bus phase controller, and 106 an SCSI bus interface.
As shown in FIG. 1, the host system interface 101 controls access to internal registers incorporated in the main sequence controller 102. The internal register includes a controller status register for indicating the operation status of the SCSI controller and an interrupt status register for storing the information as to the cause of interruption when a host CPU is interrupted with an interrupt signal (INT) 110 issued from the host system interface 101.
A signal for permitting the SCSI controller to respond as a target during the selection operation is connected to the arbitration/selection controller 104 from the main sequence controller 102 which controls the entire SCSI controller. The arbitration/selection controller 104 makes a decision as to winning or losing in arbitration, and monitors ID on the SCSI data bus when the initiator has selected the SCSI controller as the target. When the ID at issue agrees with its own ID, if the select enabling signal (SENA) outputted from the main sequence controller 102 is high, the arbitration/selection controller 104 asserts the busy signal (BSY) through the SCSI bus interface 106 so that the SCSI controller responds as a target.
Particularly, the SCSI interface protocol is given in "ANSI X3.131-1986 Small Computer System Interface" and "ANSI X3T9.2/86-109 Revision 10c, Small Computer System Interface - 2".
When the SCSI controller has become the target, the arbitration/selection controller 104 causes the SCSI bus phase controller 105 to determine the SCSI bus phase and controls a message signal (MSG), a control/data signal (C/D) and an input/output signal (I/O) through the SCSI bus interface 106 to determine the SCSI bus phase on the SCSI control bus. The phrase register 103 is only used to store the SCSI bus phase in the main sequence controller 102.
The above prior art has the following problem to be solved. Where the initiator has selected an SCSI controller as a target, if the host CPU issues an auto-target-command for the SCSI controller which has already become the target, the SCSI controller, which has already been selected, cannot be selected by the auto-target-command. Thus, the auto-target-command will be disposed of as an invalid command. The command performing "select wait" such as the auto-target-command is therefore bound by the condition that it must be issued before the initiator makes the selection. But, it is difficult to ensure that the auto-target-command be issued always before the initiator actually makes the selection.
Where an arrangement is such that a mode register provided within the SCSI controller initially makes the setting as to whether or not the SCSI controller should respond to selection/reselection, it is required that, before the "select wait" is performed while the auto-target-command is being processed, the contents of the register be changed from the non-responding mode to the responding mode. However, the prior art SCSI controller is not permitted to perform a write operation for the mode register while it processes the command.
For this reason, the auto-target-command which includes the phase for the "select wait" must always be issued before the initiator makes the selection, which means that the target must know in advance the operation of the initiator. This requires a command to be used exclusively to perform only the processing for each phase. This gives rise to a problem that, with a standard sequence, there will be a large overhead. Specifically, where the target is a magnetic disk drive using a floppy disk as a recording media, the processing when a read command is issued is as follows.
The commands to be issued for the target are a send command sending an identify message, a receive command receiving a read command, a send command sending a data on the magnetic disk, a send command sending a status byte and a send command sending a command complete message. In order to issue these commands, the controller status register in which the operation of the SCSI controller is written as it takes place must be read to confirm that the controller is not operating. Further, when the operation is completed, an interruption occurs in the host CPU so that the host CPU reads the interrupt status to confirm what the cause of interruption is.
Thus, the above five commands must be issued for the SCSI controller which is the target. Further, in order to read the controller status and the interrupt status each time the command is issued, at least 20 times of I/O access are required. Assuming that, in a system composed of a CPU having a minimum instruction cycle of 200 ns and an SCSI controller supporting the high speed synchronous transfer rate of 10 MB/s, read for I/O access includes 14 cycles and write therefor includes 10 cycles, three times of I/O read and one time of the I/0 write are required so that the overhead time T.sub.o due to the I/O access only can be represented by: EQU T.sub.o =(15 times.times.14+5 times.times.10).times.200 ns=52.0 .mu.s.
In the high speed synchronous transfer rate of 10 MB/s, the time taken for one sector to transfer the 1024 byte data of the magnetic disk (e.g., a floppy disk) to the initiator is 124.0 .mu.s, so that the overhead time due to the I/O access only occupies 40% or more of the transfer time. Thus, If the auto-target-command cannot be used, the processing capability will deteriorate greatly. This is a problem to be solved by the invention, in the conventional SCSI controllers.